<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui">


<h:head>
	<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1" />
	<meta http-equiv="refresh"
		content="#{session.maxInactiveInterval};url=index.xhtml?reason=expired" />
</h:head>
<h:body>
	<ui:composition template="/template.xhtml">
		<ui:define name="top">
			<ui:include src="topo.xhtml" />
		</ui:define>


		<ui:define name="left">
			<ui:include src="/menu.xhtml" />
		</ui:define>


		<ui:define name="content">
			<f:view>
				<f:loadBundle basename="messages" var="msgs" />

				<rich:panel header="Resumo" headerClass="page_title">

					<h:form id="frmIndex">

						<h:panelGrid columns="2">
							<h:outputText value="Conta: " />
							<h:selectOneMenu id="somConta"
								value="#{mbResumo.tela.idContaSelecionado}" required="true"
								requiredMessage='Selecione uma conta!' onchange="submit()"
								valueChangeListener="#{mbResumo.geraExtrato}">
								<f:selectItem itemValue="0" itemLabel="Selecione" />
								<f:selectItems value="#{mbResumo.tela.selectContas}" />
							</h:selectOneMenu>
						</h:panelGrid>
						<h:message for="somConta" styleClass="alerta-vermelho" />
						<p:message for="frmIndex" />

					</h:form>

					<h:form id="frmExtrato"
						rendered="#{mbResumo.tela.visibilidadeForm}">
						<h:panelGrid columns="2" styleClass="tabela600" columnClasses="col30l, col70r">
							<h:outputText value="Conta:" />
							<h:outputText value="#{mbResumo.tela.extrato.conta.descricao}" />
							<h:outputText value="Entradas:" />
							<h:outputText value="#{mbResumo.tela.extrato.entrada}" styleClass="escuro-azul">
								<f:convertNumber currencyCode="BRL" minFractionDigits="2"
									type="currency" />
							</h:outputText>
							<h:outputText value="Saidas:"/>
							<h:outputText value="#{mbResumo.tela.extrato.saida}" styleClass="escuro-vermelho">
								<f:convertNumber currencyCode="BRL" minFractionDigits="2"
									type="currency" />
							</h:outputText>
							<h:outputText value="Entradas Parc:" />
							<h:outputText value="#{mbResumo.tela.extrato.parceladoE}" styleClass="escuro-azul">
								<f:convertNumber currencyCode="BRL" minFractionDigits="2"
									type="currency" />
							</h:outputText>
							<h:outputText value="Saidas Parc:" />
							<h:outputText value="#{mbResumo.tela.extrato.parceladoS}" styleClass="escuro-vermelho">
								<f:convertNumber currencyCode="BRL" minFractionDigits="2"
									type="currency" />
							</h:outputText>
							<h:outputText value="Saldo:" />
							<h:outputText value="#{mbResumo.tela.extrato.saldo}" styleClass="alerta-azul" 
							rendered="#{!mbResumo.tela.negativo}">
								<f:convertNumber currencyCode="BRL" minFractionDigits="2"
									type="currency" />
							</h:outputText>
							<h:outputText value="#{mbResumo.tela.extrato.saldo}" styleClass="alerta-vermelho" 
							rendered="#{mbResumo.tela.negativo}">
								<f:convertNumber currencyCode="BRL" minFractionDigits="2"
									type="currency" />
							</h:outputText>
						</h:panelGrid>
						<p:message for="frmExtrato" />
					</h:form>
				</rich:panel>

			</f:view>
		</ui:define>
	</ui:composition>
</h:body>
</html>